import lookup from "./mixins/lookup";
import parseArray from "./parseArray";
export default function renderTemplate(tokens, data) {
    console.log("-> tokens", tokens);
    let resStr = '';
    for (let i = 0; i < tokens.length; i++) {
        let token = tokens[i];
        console.log("-> token", token);
        if (token[0] === "#") {
            resStr += parseArray(token, data);
        } else if (token[0] === "name") {
            resStr += lookup(data,token[1])
        } else if(token[0] === "text") {
            resStr += token[1]
        }
    }

    console.log("-> resStr", resStr);
    return resStr
}
